﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace drcoderz.com.clocks.chrono
{
    public class ChronoButton : Control
    {
        public ChronoButton()
        {
            this.DefaultStyleKey = typeof(ChronoButton);
        }

        public event EventHandler OnChronoClickEvent;

        private Button chronoBtn;

        public override void OnApplyTemplate()
        {
            chronoBtn = this.GetTemplateChild("chronoBtn") as Button;
            chronoBtn.Click += new RoutedEventHandler(OnChronoClick);
            base.OnApplyTemplate();
        }

        private void OnChronoClick(object sender, RoutedEventArgs e)
        {
            if (OnChronoClickEvent != null)
            {
                OnChronoClickEvent(this, new EventArgs());
            }
        }
    }
}
